/*    */ package com.zimbra.cs.redolog;
/*    */ 
/*    */ import com.zimbra.common.util.ByteUtil;
/*    */ import java.io.DataInput;
/*    */ import java.io.DataInputStream;
/*    */ import java.io.IOException;
/*    */ import java.io.InputStream;
/*    */ import java.io.RandomAccessFile;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class RedoLogInput
/*    */ {
/*    */   private DataInput mIN;
/*    */   private String mPath;
/*    */   
/*    */   public RedoLogInput(InputStream is)
/*    */   {
/* 41 */     this.mIN = new DataInputStream(is);
/*    */   }
/*    */   
/*    */   public RedoLogInput(RandomAccessFile raf, String path) {
/* 45 */     this.mPath = path;
/* 46 */     this.mIN = raf;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */   public String getPath()
/*    */   {
/* 54 */     return this.mPath;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */   public long getFilePointer()
/*    */     throws IOException
/*    */   {
/* 63 */     if ((this.mIN instanceof RandomAccessFile)) {
/* 64 */       RandomAccessFile file = (RandomAccessFile)this.mIN;
/* 65 */       return file.getFilePointer();
/*    */     }
/* 67 */     return -1L;
/*    */   }
/*    */   
/* 70 */   public int skipBytes(int n) throws IOException { return this.mIN.skipBytes(n); }
/* 71 */   public void readFully(byte[] b) throws IOException { this.mIN.readFully(b); }
/* 72 */   public void readFully(byte[] b, int off, int len) throws IOException { this.mIN.readFully(b, off, len); }
/* 73 */   public boolean readBoolean() throws IOException { return this.mIN.readBoolean(); }
/* 74 */   public byte readByte() throws IOException { return this.mIN.readByte(); }
/* 75 */   public int readUnsignedByte() throws IOException { return this.mIN.readUnsignedByte(); }
/* 76 */   public short readShort() throws IOException { return this.mIN.readShort(); }
/* 77 */   public int readUnsignedShort() throws IOException { return this.mIN.readUnsignedShort(); }
/* 78 */   public int readInt() throws IOException { return this.mIN.readInt(); }
/* 79 */   public long readLong() throws IOException { return this.mIN.readLong(); }
/* 80 */   public double readDouble() throws IOException { return this.mIN.readDouble(); }
/*    */   
/*    */   public String readUTF() throws IOException {
/* 83 */     return ByteUtil.readUTF8(this.mIN);
/*    */   }
/*    */   
/*    */   public String[] readUTFArray() throws IOException {
/* 87 */     int count = readInt();
/* 88 */     if (count < 0) {
/* 89 */       return null;
/*    */     }
/*    */     
/* 92 */     String[] v = new String[count];
/* 93 */     for (int i = 0; i < count; i++) {
/* 94 */       v[i] = readUTF();
/*    */     }
/* 96 */     return v;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/RedoLogInput.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */